#ifndef GUI_FRAME_H
#define GUI_FRAME_H

#include "widget.h"
#include "../animations/opening_rect.h"
#include "../animations/color_transition.h"

#include <QString>
#include <QFontMetrics>

class GuiFrame: public Widget,
                private AnimationObserver
{

public:

    GuiFrame( Widget* _parent, Engine* _engine, const QString& title,
              int _x, int _y, int _w, int _h, int openingTime = 1000 );
    virtual ~GuiFrame( void );

protected:

    virtual void doShow( void );
    virtual void doHide( void );

    virtual void Paint( QPainter &painter );

    virtual void OnPause(Animation* a);
    virtual void OnStop(Animation* a);
    virtual void OnEnd(Animation* a);
    virtual void OnPlay(Animation* a);

private:

    QString title;
    int ascent;
    int descent;
    int titleWidth;
    OpeningRect* oRect;
    Animation* opening;
    ColorTransition* ct;
    QPen blackPen;
    QBrush invisibleBrush;

};

#endif // GUI_FRAME_H
